﻿
$(document).ready(function () {

    var jsonEnterprise = {
        enterpriseId: $('form').attr("id"),
    };

    getEnterprise(jsonEnterprise);





});

function getEnterprise(jsonEnterprise) {
    $.ajax({
        type: "POST",
        data: JSON.stringify(jsonEnterprise),
        dataType: "json",
        contentType: "application/json; charset=utf-8",
        url: "getEnterprise",
        success: function (data) {
            
            $('#txtRUC').val(data.ruc);
            $('#txtSocialReason').val(data.socialReason);
            $('#txtSector').val(data.sectorName);
            $('#txtRisk').val(data.cem);
            $('#txtDate').val(data.creationDateAux);
            $('#txtEconomicGroup').val(data.economicGroupName);
            $('#txtValue').val(data.defaultState);
            $('#txtName').val(data.agentName);
            $('#txtFirstName').val(data.agentFirstName);
            $('#txtLastName').val(data.agentLastName);
            $('#txtAddress').val(data.officialAddress);
            $('#txtDNI').val(data.agentDNI);
            $('#txtPhone').val(data.agentPhone);
            $('#txtEmail').val(data.agentEmail);


        }

    });//Fin del Ajax
}